package CompositePattern;

import CompositePattern.exception.OperationNotSupportException;

public abstract class AbstractComponent { //抽象构件
    public void addComponent(AbstractComponent ac){
        throw new OperationNotSupportException("叶子节点不支持添加操作。");
    }

    public void removeComponent(AbstractComponent ac){
        throw new OperationNotSupportException("叶子节点不支持删除操作。");
    }

    public AbstractComponent getComponent(int index){
        throw new OperationNotSupportException("叶子节点没有孩子节点");
    }
    public abstract void killVirus();

















}
